
<form id="add-form" class="form-horizontal col-sm-12" role="form" data-toggle="validator" method="POST" action="">
	{:token()}
	<input type="hidden" name="row[id]" value="{$row.id}">

	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label for="c-start_time">开始工作时间:</label>
			<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="开始工作时间" name="row[start_time]" type="text">
		</div>
	</div>
	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label>维修结果:</label>
			{:build_radios('row[resolved_results]', ['1'=>__('已解决'), '12'=>__('维修失败')])}
		</div>
	</div>
	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label>检查/故障判断:</label>
			<textarea class="form-control" rows="3" name="row[results]" placeholder="请填写检查/故障判断"></textarea>
		</div>
	</div>
	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label>是否更换配件:</label>
			{:build_radios('row[is_replace]', ['0'=>__('否'), '1'=>__('是')])}
		</div>
	</div>
	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label>是否回收配件:</label>
			{:build_radios('row[is_recovery]', ['0'=>__('否'), '1'=>__('是')])}
		</div>
	</div>

	<div class="col-xs-12 col-sm-12">
		<div class="form-group col-sm-12">
			<dl class="fieldlist" data-name="row[use_parts]" data-template="testtpl">
				<dd>
					<label>配件费用:</label><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i
						class="fa fa-plus"></i> 添加配件</a>
				</dd>
				<textarea name="row[use_parts]" class="form-control hide" cols="30" rows="5"></textarea>
			</dl>
		</div>
	</div>
	<div class="col-xs-12 col-sm-6">
		<div class="form-group col-sm-10">
			<label>保养注意事项:</label>
			<textarea class="form-control" rows="3" name="row[maintain]" placeholder="请填写保养注意事项"></textarea>
		</div>
	</div>

	<div class="form-group layer-footer">
		<label class="control-label col-xs-12 col-sm-2"></label>
		<div class="col-xs-12 col-sm-8">
			<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
		</div>
	</div>
</form>
<!--定义模板-->
<script type="text/html" id="testtpl">
	<dd>
		<div class="form-inline" style="margin-bottom:20px;display: flex;">
			<span>配件名称:<input type="text" data-source="qingdongams/common/getParts"
							  class="form-control selectpage" name="row[<%=name%>][<%=index%>][id]"
							  data-field="name" data-primary-key="id" style="width: 200px;"
							  value="<%=row['product_id']%>"/></span>
			<span>数量:<input type="number"  class="form-control  " name="row[<%=name%>][<%=index%>][number]"
							value="<%=row['number']%>" style="width: 100px;"/></span>

			<span style="margin-left: 10px"><span class="btn btn-sm btn-danger btn-remove"><i
					class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i
					class="fa fa-arrows"></i></span></span>
		</div>
	</dd>
</script>
